<?php
error_reporting(7);
$config_file = "../../../inc/config/config.php";
require_once $config_file;

ini_set('include_path', ini_get('include_path').PATH_SEPARATOR.INCLUDE_PATH . DS . "library"  );
ini_set('include_path',  ini_get('include_path').PATH_SEPARATOR.INCLUDE_PATH . DS . "config"  );

require "constants.php";

if (_CACHE_SYSTEM == 'file') {
    require_once "class.smartcache.php";
    $_CONFIG['cache_dir'] = "../../tmp/cache";
    $_CONFIG['hash_dir'] = 1;
    if (!file_exists($_CONFIG['cache_dir'])) {
        mkdir($_CONFIG['cache_dir'], 0777);
    }
} else {
    require_once "class.memcache.php";
}

require"db_mysql.php";
require_once "functions.php";
require_once "class.pager.php";
require "tools/function/FunctionUtils.php";

if ($_SESSION['isadmin'] != 1) {
    //die(@FunctionUtils::emptyJSON("登陆失效,请重新登陆再尝试该操作！"));
}
$iDB=new db_MySQL();
$iDB->server = $_DB_INFO['general']['server'];
$iDB->database = $_DB_INFO['general']['database'];
$iDB->user = $_DB_INFO['general']['user'];
$iDB->password = $_DB_INFO['general']['password'];
$iDB->connect();
$iDB->selectdb();
$iDB->query("SET NAMES 'utf8'");

require_once 'class.session.php';
$session = &new session($iDB);
session_start();
if(empty($_SESSION['admininfo']['realname']))$userinfo=$_SESSION['admininfo']['username'];
else $userinfo=$_SESSION['admininfo']['realname'];